<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@include file="header.jsp"%>
<div class="clearfix"></div>
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>修改密码 <i class="fa fa-user"></i>${student.name}</h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_title">
                <h2>学生密码修改</h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content1">
                <div class="x_content" style="display: block;">
                    <form class="form-horizontal form-label-left" name="form"
                          action="${pageContext.request.contextPath }/student/updatePassword" method="post">
                        <input type="hidden" name="id" value="${student.id}">
                        <div class="item form-group">
                            <div style="color: red">${error}</div>
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">旧密码<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="password" name="oldPassword" class="form-control" placeholder="oldPassword"/>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">新密码 <span class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="password" name="newPassword" class="form-control"  placeholder="newPassword"/>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">在次输入 <span class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input type="password" name="newPassword2" class="form-control"  placeholder="newPassword"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-3">
                                <button id="status" type="submit" onclick="checkPass()" name="status" value="2" class="btn btn-success">保存修改</button>
                                <button type="button" class="btn btn-primary" id="back">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <%@include file="footer.jsp"%>
            <script>
                function checkPass() {
                    var pass1 = form.newPassword.value();
                    var pass2 = form.newPassword2.value();
                    if(pass1==pass2){
                        alert("两次密码不一致");
                        document.getElementById("status").disabled="true";
                    }
                }
            </script>